﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TaiLieu;
using DevExpress.Xpo;

public partial class tl_menu1 : System.Web.UI.UserControl
{
    public string tam = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        //tam = login();
    }
    public string setvalue()
    {
        ICollection<TaiLieu.Menu> list_Category = MenuDB.GetMenuFrontend();
        string tam1 = "";
        if (list_Category == null) return "";
        int dem = 1;
        foreach (TaiLieu.Menu item in list_Category)
        {
            tam1 += @"<li class=""havechild ""><a href=""?" + item.query + @"""class=""" + css(item.query) + @""" id=""" + item.query + @"""><span>" + item.Name + "</span></a>";
            tam1 += @"</li>";
            dem++;
        }
        return tam1;
    }
    public string css_trang_chu()
    {
        string query = QueryHelper.Get_Value(Request, 1);
        if ((query == "" || QueryHelper.Get_Value(Request, 1) == "trang-chu"))
            return "active first-item";
        return "";

    }
    public string css(string NameEL)
    {

        if (QueryHelper.Get_Value(Request, 1) != "" && NameEL.Contains(QueryHelper.Get_Value(Request, 1)) == true)
            return "active first-item";
        else
            return "";

    }
    
}
